import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import './plugins/element.js'
import axios from 'axios'
//导入字体图标
import './assets/fonts/iconfont'
//导入表格依赖
import TableTree from 'vue-table-with-tree-grid'
Vue.component('table-tree', TableTree)
//导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// 富文本编辑器样式
// import 'quill/dist/quill.core.css'
// import 'quill/dist/quill.snow.css'
// import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor, /* { default global options } */ )
//导入页面刷新进度条
import Nprogress from 'nprogress'
// import 'nprogress/nprogress.css'

axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// axios请求拦截器，在这里展示进度条
axios.interceptors.request.use(config => {
  Nprogress.start()
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config;
})
//axios响应拦截，在这里隐藏进度条
axios.interceptors.response.use(config => {
  Nprogress.done()
  return config
})
Vue.prototype.$http = axios
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')